<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />

  <title>Class: Hand</title>

  <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />

  <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>

</head>
<body id="top" class="class">

  <div id="metadata">
    <div id="home-metadata">
      <div id="home-section" class="section">
        <h3 class="section-header">
          <a href="./index.html">Home</a>
          <a href="./index.html#classes">Classes</a>
          <a href="./index.html#methods">Methods</a>
        </h3>
      </div>
    </div>

    <div id="file-metadata">
      <div id="file-list-section" class="section">
        <h3 class="section-header">In Files</h3>
        <div class="section-body">
          <ul>
          
            <li><a href="./hand_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
              class="thickbox" title="hand.rb">hand.rb</a></li>
          
          </ul>
        </div>
      </div>

      
    </div>

    <div id="class-metadata">
      
      <!-- Parent Class -->
      <div id="parent-class-section" class="section">
        <h3 class="section-header">Parent</h3>
        
        <p class="link"><a href="Object.html">Object</a></p>
        
      </div>
      

      

      

      
      <!-- Method Quickref -->
      <div id="method-list-section" class="section">
        <h3 class="section-header">Methods</h3>
        <ul class="link-list">
          
          <li><a href="#method-c-new">::new</a></li>
          
          <li><a href="#method-i-add">#add</a></li>
          
          <li><a href="#method-i-each">#each</a></li>
          
          <li><a href="#method-i-no_of_cards">#no_of_cards</a></li>
          
          <li><a href="#method-i-pick_random">#pick_random</a></li>
          
          <li><a href="#method-i-to_string">#to_string</a></li>
          
        </ul>
      </div>
      

      
    </div>

    <div id="project-metadata">
      
      

      <div id="classindex-section" class="section project-section">
        <h3 class="section-header">Class/Module Index
          <span class="search-toggle"><img src="./images/find.png"
            height="16" width="16" alt="[+]"
            title="show/hide quicksearch" /></span></h3>
        <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
        <fieldset>
          <legend>Quicksearch</legend>
          <input type="text" name="quicksearch" value=""
            class="quicksearch-field" />
        </fieldset>
        </form>

        <ul class="link-list">
        
          <li><a href="./Card.html">Card</a></li>
        
          <li><a href="./CardList.html">CardList</a></li>
        
          <li><a href="./Deck.html">Deck</a></li>
        
          <li><a href="./Hand.html">Hand</a></li>
        
          <li><a href="./Object.html">Object</a></li>
        
          <li><a href="./Pile.html">Pile</a></li>
        
          <li><a href="./Player.html">Player</a></li>
        
          <li><a href="./Poker.html">Poker</a></li>
        
          <li><a href="./TC_Card.html">TC_Card</a></li>
        
          <li><a href="./TC_Deck.html">TC_Deck</a></li>
        
          <li><a href="./TC_Hand.html">TC_Hand</a></li>
        
          <li><a href="./TC_Pile.html">TC_Pile</a></li>
        
        </ul>
        <div id="no-class-search-results" style="display: none;">No matching classes.</div>
      </div>

      
    </div>
  </div>

  <div id="documentation">
    <h1 class="class">Hand</h1>

    <div id="description" class="description">
      
<p>Represents a hand of cards in a card game.</p>

    </div><!-- description -->

    
    
    
    <div id="5Buntitled-5D" class="documentation-section">
      

      

      

      

      <!-- Methods -->
      
      <div id="public-class-method-details" class="method-section section">
        <h3 class="section-header">Public Class Methods</h3>

      
        <div id="new-method" class="method-detail ">
          <a name="method-c-new"></a>

          
          <div class="method-heading">
            <span class="method-name">new</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Create an empty hand.</p>
            

            
            <div class="method-source-code" id="new-source">
<pre>
<span class="ruby-comment"># File hand.rb, line 7</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
  <span class="ruby-ivar">@card_list</span>= <span class="ruby-constant">CardList</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- new-source -->
            
          </div>

          

          
        </div><!-- new-method -->

      
      </div><!-- public-class-method-details -->
    
      <div id="public-instance-method-details" class="method-section section">
        <h3 class="section-header">Public Instance Methods</h3>

      
        <div id="add-method" class="method-detail ">
          <a name="method-i-add"></a>

          
          <div class="method-heading">
            <span class="method-name">add</span><span
              class="method-args">(card)</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Add card to hand.</p>
            

            
            <div class="method-source-code" id="add-source">
<pre>
<span class="ruby-comment"># File hand.rb, line 12</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add</span> <span class="ruby-identifier">card</span>
  <span class="ruby-ivar">@card_list</span>.<span class="ruby-identifier">add</span> <span class="ruby-identifier">card</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- add-source -->
            
          </div>

          

          
        </div><!-- add-method -->

      
        <div id="each-method" class="method-detail ">
          <a name="method-i-each"></a>

          
          <div class="method-heading">
            <span class="method-name">each</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>iterate over all cards in hand</p>
            

            
            <div class="method-source-code" id="each-source">
<pre>
<span class="ruby-comment"># File hand.rb, line 28</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
  <span class="ruby-ivar">@card_list</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">card</span><span class="ruby-operator">|</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">card</span>}
<span class="ruby-keyword">end</span></pre>
            </div><!-- each-source -->
            
          </div>

          

          
        </div><!-- each-method -->

      
        <div id="no_of_cards-method" class="method-detail ">
          <a name="method-i-no_of_cards"></a>

          
          <div class="method-heading">
            <span class="method-name">no_of_cards</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Return number of cards in hand</p>
            

            
            <div class="method-source-code" id="no_of_cards-source">
<pre>
<span class="ruby-comment"># File hand.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">no_of_cards</span>
  <span class="ruby-ivar">@card_list</span>.<span class="ruby-identifier">no_of_cards</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- no_of_cards-source -->
            
          </div>

          

          
        </div><!-- no_of_cards-method -->

      
        <div id="pick_random-method" class="method-detail ">
          <a name="method-i-pick_random"></a>

          
          <div class="method-heading">
            <span class="method-name">pick_random</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Remove a random card from the hand and return it. Return false if deck
empty.</p>
            

            
            <div class="method-source-code" id="pick_random-source">
<pre>
<span class="ruby-comment"># File hand.rb, line 23</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pick_random</span>
  <span class="ruby-ivar">@card_list</span>.<span class="ruby-identifier">pick_random</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- pick_random-source -->
            
          </div>

          

          
        </div><!-- pick_random-method -->

      
        <div id="to_string-method" class="method-detail ">
          <a name="method-i-to_string"></a>

          
          <div class="method-heading">
            <span class="method-name">to_string</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Return card as string</p>
            

            
            <div class="method-source-code" id="to_string-source">
<pre>
<span class="ruby-comment"># File hand.rb, line 17</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_string</span>
  <span class="ruby-ivar">@card_list</span>.<span class="ruby-identifier">to_s</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- to_string-source -->
            
          </div>

          

          
        </div><!-- to_string-method -->

      
      </div><!-- public-instance-method-details -->
    
    </div><!-- 5Buntitled-5D -->
  

  </div><!-- documentation -->

  <div id="validator-badges">
    <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
    <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
      Rdoc Generator</a> 2</small>.</p>
  </div>

</body>
</html>

